Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Complementary polyfills for @webcomponents/webcomponentsjs
Property/Method | Target Class | Target Browsers | Features |
---|---|---|---|
attributeChangedCallback() | Custom element base class | IE 11, Edge, Safari 9 | Attribute changes via properties |
children | DocumentFragment | IE 11 | |
children | SVGElement | IE 11 | |
from() | Array | IE 11 | Iterable protocol |
constructor() | Set | IE 11 | Iterable initializer |
Symbol.species | Set | IE 11 | |
Symbol.iterator | Set | IE 11 | |
values() | Set | IE 11 | |
add() | Set | IE 11 | Key equality for -0 and 0 |
has() | Set | IE 11 | Key equality for -0 and 0 |
constructor() | Map | IE 11 | Iterable initializer |
Symbol.species | Map | IE 11 | |
Symbol.iterator | Map | IE 11 | |
keys() | Map | IE 11 | |
values() | Map | IE 11 | |
entries() | Map | IE 11 | |
set() | Map | IE 11 | Key equality for -0 and 0 |
has() | Map | IE 11 | Key equality for -0 and 0 |
npm install wc-putty
import { polyfill } from 'wc-putty/polyfill.js';
// Polyfilled only on IE11, Edge, and Safari 9
class MyElement extends polyfill(HTMLElement) {
static get observedAttributes() { return [ 'lang' ] }
attributeChangedCallback(name, oldValue, newValue) {
// Attribute changes via built-in properties such as lang are detected properly
// Attribute changes via setAttribute() are detected and the method is called only once per change
}
}
customElements.define('my-element', MyElement);
// Triggers attributeChangedCallback('lang', null, 'en-US')
document.createElement('my-element').lang = 'en-US';
// Polyfilled only on IE 11
// Set
let set = new Set([0, -0, 1]);
set.size === 2; // key equality for -0 and 0
set.has(-0) && set.has(0) && set.has(1);
[...set]; // spread iterable
for (let item of set) {} // iterate over a Set object
// Map
let map = new Map((function * () { yield * [0, -0, 1]; })());
map.size === 2; // key equality for -0 and 0
map.has(-0) && map.has(0) && map.has(1);
@webcomponents/webcomponentsjs/webcomponents-{bundle|loader}.js
have to be loaded beforehandattributeChangedCallback()
polyfill.js
is provided as an ES module and evaluated only once to polyfill the target global objectssetAttributeNS()
can trigger 2 calls of attributeChangedCallback()
if polyfilled by polyfill()
mixinFAQs
Complementary polyfills for @webcomponents/webcomponentsjs
The npm package wc-putty receives a total of 1 weekly downloads. As such, wc-putty popularity was classified as not popular.
We found that wc-putty demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.